import React from 'react'

import './style.scss'

class Header extends React.Component{
    constructor(props, context){
        super(props, context)
    }
    render() {
        return (
            <div className='header'>
                <i className="iconfont icon-fanhui" onClick={this.clickHandle.bind(this)}></i>
                {this.props.title}
            </div>
        )
    }
    componentDidMount() {
        
    }
    clickHandle() {
        const backRouter = this.props.backRouter
        if(backRouter) {
            this.props.history.push(backRouter)
        } else{
            window.history.back()
        }
    }
}

export default Header